package com.example.dto.business;

import com.example.pojo.User;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @author LeXin Huang
 * @date 2021年03月28日 11:34
 */
@ApiModel("用户信息")
@NoArgsConstructor
@Data
@ToString
public class UserBusinessDTO {
    @ApiModelProperty("用户id")
    private
    Integer userId;

    @ApiModelProperty("用户头像路径")
    private
    String userPortraitPath;

    @ApiModelProperty("用户名称")
    private
    String username;

    @ApiModelProperty("用户个人介绍")
    private
    String userIntroduction;

    @ApiModelProperty("用户邮箱")
    String userEmailAddress;

    public UserBusinessDTO(User user) {
        this.userId = user.getId();
        this.userPortraitPath = user.getPortraitPath();
        this.username = user.getUsername();
        this.userIntroduction = user.getIntroduction();
        this.userEmailAddress = user.getEmailAddress();
    }
}
